#include <stdio.h>

#include "mp3decoder.h"

int main (int argc, const char * argv[]) 
{
    // insert code here...
	
	if(argc < 2)
	{
		printf("\r\nusage: oE6 [filename.mp3]\r\n\r\n");
		return 0;
	}
	
	if(oEopen((char*)argv[1]) == 0)
	{
		printf("\r\noE6: Error opening file %s\r\n\r\n", argv[1]);
		return 0;
	}
	
	printf("\r\noE6: Decoding %s\r\n\r\n", argv[1]);
	while(!oEEOF())
	{
		if(decodeframe() == -1)
		{
			//unable to read enough data
			break;
		}
	}
	
	oEclose();
    
	return 1;
}
